#include <stdio.h>
#include <stdlib.h>

char* convertToTitle(int columnNumber)
{
    char * s = malloc(sizeof(char)*26) ;
    // s = NULL;
    int i = 0;
    while(columnNumber != 0)
    {
        int n = (columnNumber - 1) % 26 + 1;
        s[i++] = n - 1 +'A';
        columnNumber =(columnNumber - n) / 26;
    }
    s[i] = '\0';
    for(int j = 0;j <= (i - 1) / 2;j++)
    {
        char c = s[j];
        s[j] = s[i - 1 - j];
        s[i - 1 - j] = c;
    }
    return s;
}

int main()
{
    int columnNumber = 260;
    char * p = convertToTitle(columnNumber);
    printf("%s\n",p);
    return 0;
}